﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.BlobStoring;

namespace WMSSystem.YJ.Interface
{
    public interface IFileAppService : IApplicationService
    {
        /// <summary>
        /// 上传文件到七牛云
        /// </summary>
        /// <param name="file">要上传的文件</param>
        /// <returns>上传后的文件访问URL</returns>
        Task<string> UploadFileToQiniuAsync(IFormFile file);

        /// <summary>
        /// 从七牛云下载文件
        /// </summary>
        /// <param name="fileName">文件名</param>
        /// <returns>文件字节数组</returns>
        Task<byte[]> DownloadFileFromQiniuAsync(string fileName);

        /// <summary>
        /// 删除七牛云中的文件
        /// </summary>
        /// <param name="fileName">文件名</param>
        Task DeleteFileFromQiniuAsync(string fileName);

        /// <summary>
        /// 获取七牛云上传凭证
        /// </summary>
        /// <returns>上传凭证</returns>
        Task<string> GetQiniuUploadTokenAsync();
    }
}
